package tech.aistar.mapper;

import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tech.aistar.entity.Sinchoice;


import java.util.List;

@Repository
public interface SinchoiceMapper {
    @Select("select * from sinchoice")
    List<Sinchoice> findAll();

    @Select("select * from sinchoice where sin_id = #{value}")
    Sinchoice findById(Long id);

    @Select("select sin_id, sin_stem, sin_opt_a, sin_opt_b, sin_opt_c, sin_opt_d  from sinchoice s  join questionpaper q on s.sin_id = q.que_id where q.paper_id = #{value}  and que_type =1")
    List<Sinchoice> findByPaperId(Long paperId);

    @Select("select sin_answer from sinchoice where sin_id = #{value}")
    String findAnswerByid(Long id);


}
